package com.cskaoyan.servlet;



import com.cskaoyan.bean.PageData;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.common.CommonServlet;
import com.cskaoyan.model.MarketRegion;
import com.cskaoyan.service.RegionService;
import com.cskaoyan.service.impl.RegionServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;


@WebServlet("/admin/region/*")
public class AdminRegionServlet extends CommonServlet {
    RegionService regionService = new RegionServiceImpl();

    public BaseRespVo list(HttpServletRequest request, HttpServletResponse response) throws IOException {
        List<MarketRegion> list = regionService.getList();
        PageData data = PageData.list(list);
        return BaseRespVo.ok(data);
    }
}
